package com.airtight.objects;

import com.airtight.programs.TextureShaderProgram;

import static android.opengl.Matrix.orthoM;

public class Background extends Object{
    private final float[] backgroundMatrix = new float[16];
    private float transparency = 1f;

    public Background(float x, float y, float width, float height) {
        super(x,y,width,height);
        orthoM(backgroundMatrix, 0, -1f, 1f, -1, 1, -1, 1f);
    }

    public void drawBackground(TextureShaderProgram textureProgram, int asset){
        // Draw the background
        textureProgram.useProgram();                //binds the vertex and fragment shader
        textureProgram.setTexture(backgroundMatrix, asset);
        textureProgram.setOpacity(transparency);
        bindData(textureProgram);
        draw();
    }
}

